import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

export interface ModuleInfo {
  id: number;
  name: string;
  type: string;
  html: string;
  is_loop: boolean;
}

export interface ModuleParams extends BasicPageParams {
  name?: string;
  type?: string;
}

export interface ModuleListGetResultModel extends BasicFetchResult<ModuleInfo> {}

// Request Types
export interface ModuleAddReq {
  name: string;
  type: string;
  html: string;
  is_loop: boolean;
}

export interface ModuleEditReq extends ModuleAddReq {
  id: number;
}

export interface ModuleDelReq {
  id: number;
}

// Module Type
export interface ModuleTypeInfo {
  id: number;
  name: string;
  desc: string;
}

export interface ModuleTypeParams extends BasicPageParams {}

export interface ModuleTypeListGetResultModel extends BasicFetchResult<ModuleTypeInfo> {}

export interface ModuleTypeAddReq {
  name: string;
  desc: string;
}

export interface ModuleTypeEditReq extends ModuleTypeAddReq {
  id: number;
}

export interface ModuleTypeDelReq {
  id: number;
}

// Module Attr
export interface ModuleAttrInfo {
  id: number;
  name: string;
  type: string;
  key: string;
  value: string;
  desc: string;
}

export interface ModuleAttrParams extends BasicPageParams {
  name?: string;
  key?: string;
}

export interface ModuleAttrListGetResultModel extends BasicFetchResult<ModuleAttrInfo> {}

export interface ModuleAttrAddReq {
  name: string;
  type: string;
  key: string;
  value: string;
  desc: string;
}

export interface ModuleAttrEditReq extends ModuleAttrAddReq {
  id: number;
}

export interface ModuleAttrDelReq {
  id: number;
}
